<?php
class Heading extends Text {
	
	public static $h1 = 'h1';
	public static $h2 = 'h2';
	public static $h3 = 'h3';
	public static $h4 = 'h4';
	public static $h5 = 'h5';
	
	private $headingType;
	private $text;
	
	public function __construct($text, $headingType = 'h1', $elementId = NULL) {
		
		parent::__construct($elementId);
		
		$this->text = $text;
		$this->headingType = $headingType;
	}
	
	protected function renderElement() {
		
		$id = '';
		if ($this->elementId != NULL) {
			$id = 'id="' . $this->elementId . '"';
		}
		
		echo '<', $this->headingType, ' ', $this->formatAttributes(), ' >';
		echo $this->text;
		echo '</', $this->headingType, '>';
	}
}
?>